import http from "@/utils/http"

// 获取列表信息
export const getList = (url) => {
    return (pageNum, pageSize) => {
        return http.get(url, {
            params: {
                pageNum,
                pageSize
            }
        })
    }
}

// 删除列表项信息
export const deleteById = (url) => {
    return (id) => {
        return http.delete(`${url}/${id}`)
    }
}

// 更新列表项信息
export const updateMsg = (url) => {
    return (item) => {
        return http.put(url, {
            ...item
        })
    }
}

// 添加列表信息
export const addItem = (url) => { 
    return (item) => { 
        return http.post(url, {
            ...item
        })
    }
}